package com.woody.aggregate.infrastructure.msgsendrule.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woody.aggregate.infrastructure.msgsendrule.entity.MsgSendRuleTargetRef;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 弹窗规则关联目标表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-03-20
 */
public interface MsgSendRuleTargetRefMapper extends BaseMapper<MsgSendRuleTargetRef> {

    /**
     * 分页查询规则绑定的用户列表
     * <br />
     * @param page
     * @param ruleId
     * @return
     */
    Page<MsgSendRuleTargetRef> pageQueryTargets(Page page, @Param("ruleId") Integer ruleId);

    /**
     * 过滤并返回规则已绑定的用户列表
     * <br />
     * @param ruleId
     * @param targetType
     * @param bizIds
     * @return
     */
    List<Long> getBoundTargets(@Param("ruleId") Integer ruleId, @Param("targetType") Integer targetType, @Param("bizIds") List<Long> bizIds);
}
